package com.qf.shopping.service.impl;

import com.qf.shopping.mapper.ISystemMapper;
import com.qf.shopping.pojo.System.Menu;
import com.qf.shopping.pojo.System.Role;
import com.qf.shopping.service.SystemService;
import com.qf.shopping.vo.RolelistVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

@Service
@Transactional
public class SystemServiceImpl implements SystemService {


    @Autowired
    private ISystemMapper iSystemMapper=null;

    @Override
    public List<RolelistVO> getRoleList() {
        List<RolelistVO> rolelistVO=new ArrayList<>();
        List<Role> roles=iSystemMapper.findMenuByNameAndConut();
        for (Role r:roles) {
            rolelistVO.add(new RolelistVO(r));
        }
        return rolelistVO;
    }

    @Override
    public Menu findMenuById(int id) {
        return null;
    }

    @Override
    public void addMenu(Menu menu) {

    }

    @Override
    public void updateMenu(Menu menu) {

    }

    @Override
    public void deleteMenu(long id) {

    }
}
